package com.li.sparksql

import org.apache.spark.SparkConf
import org.apache.spark.sql.SparkSession

object CreateDataFrameByJson {
  def main(args: Array[String]): Unit = {
    val conf = new SparkConf();
    conf.setMaster("local");
    val session = SparkSession.builder()
      .appName("CreateDataFrameByJson")
      .config(conf)
      .getOrCreate()
    //读取json文件 获取dataFrame
    val stuDf = session.read.json("/Users/lijiacen/Downloads/chealse.json")

    stuDf.show()
    session.stop()

  }
}
